
/*
'===============================================================================
'  Generated From - CSharp_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  ** 
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class SqlClientEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'abstract' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  public class YourObject :  _YourObject
'  {
'
'  }
'
'===============================================================================
*/

// Generated by MyGeneration Version # (1.3.0.3)

using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Collections.Specialized;

using MyGeneration.dOOdads;

namespace POSSystem.DAL
{
	public abstract class _Products : SqlClientEntity
	{
		public _Products()
		{
			this.QuerySource = "Products";
			this.MappingName = "Products";

		}	

		//=================================================================
		//  public Overrides void AddNew()
		//=================================================================
		//
		//=================================================================
		public override void AddNew()
		{
			base.AddNew();
			
		}
		
		
		public override void FlushData()
		{
			this._whereClause = null;
			this._aggregateClause = null;
			base.FlushData();
		}
		
		//=================================================================
		//  	public Function LoadAll() As Boolean
		//=================================================================
		//  Loads all of the records in the database, and sets the currentRow to the first row
		//=================================================================
		public bool LoadAll() 
		{
			ListDictionary parameters = null;
			
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_ProductsLoadAll]", parameters);
		}
	
		//=================================================================
		// public Overridable Function LoadByPrimaryKey()  As Boolean
		//=================================================================
		//  Loads a single row of via the primary key
		//=================================================================
		public virtual bool LoadByPrimaryKey(int ID)
		{
			ListDictionary parameters = new ListDictionary();
			parameters.Add(Parameters.ID, ID);

		
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_ProductsLoadByPrimaryKey]", parameters);
		}
		
		#region Parameters
		protected class Parameters
		{
			
			public static SqlParameter ID
			{
				get
				{
					return new SqlParameter("@ID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter ProductName
			{
				get
				{
					return new SqlParameter("@ProductName", SqlDbType.NVarChar, 50);
				}
			}
			
			public static SqlParameter CategoryID
			{
				get
				{
					return new SqlParameter("@CategoryID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter IMEIAvailable
			{
				get
				{
					return new SqlParameter("@IMEIAvailable", SqlDbType.Bit, 0);
				}
			}
			
			public static SqlParameter BrandID
			{
				get
				{
					return new SqlParameter("@BrandID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter Description
			{
				get
				{
					return new SqlParameter("@Description", SqlDbType.NText, 1073741823);
				}
			}
			
			public static SqlParameter Picture
			{
				get
				{
					return new SqlParameter("@Picture", SqlDbType.NVarChar, 500);
				}
			}
			
			public static SqlParameter BarCode
			{
				get
				{
					return new SqlParameter("@BarCode", SqlDbType.NVarChar, 50);
				}
			}
			
			public static SqlParameter Cost
			{
				get
				{
					return new SqlParameter("@Cost", SqlDbType.Decimal, 0);
				}
			}
			
			public static SqlParameter DealerPrice
			{
				get
				{
					return new SqlParameter("@DealerPrice", SqlDbType.Decimal, 0);
				}
			}
			
			public static SqlParameter SalePrice
			{
				get
				{
					return new SqlParameter("@SalePrice", SqlDbType.Decimal, 0);
				}
			}
			
			public static SqlParameter Quantity
			{
				get
				{
					return new SqlParameter("@Quantity", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter GST
			{
				get
				{
					return new SqlParameter("@GST", SqlDbType.Bit, 0);
				}
			}
			
			public static SqlParameter Deleted
			{
				get
				{
					return new SqlParameter("@Deleted", SqlDbType.Bit, 0);
				}
			}
			
			public static SqlParameter LastModifiedDate
			{
				get
				{
					return new SqlParameter("@LastModifiedDate", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter LastModifiedByUser
			{
				get
				{
					return new SqlParameter("@LastModifiedByUser", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter IsNewArrival
			{
				get
				{
					return new SqlParameter("@IsNewArrival", SqlDbType.Bit, 0);
				}
			}
			
			public static SqlParameter IsHotProduct
			{
				get
				{
					return new SqlParameter("@IsHotProduct", SqlDbType.Bit, 0);
				}
			}
			
			public static SqlParameter Thumbnail
			{
				get
				{
					return new SqlParameter("@Thumbnail", SqlDbType.NVarChar, 500);
				}
			}
			
			public static SqlParameter IsHomeProduct
			{
				get
				{
					return new SqlParameter("@IsHomeProduct", SqlDbType.Bit, 0);
				}
			}
			
			public static SqlParameter IsDealerOnly
			{
				get
				{
					return new SqlParameter("@IsDealerOnly", SqlDbType.Bit, 0);
				}
			}
			
			public static SqlParameter SoldQuantity
			{
				get
				{
					return new SqlParameter("@SoldQuantity", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter RegularPrice
			{
				get
				{
					return new SqlParameter("@RegularPrice", SqlDbType.Decimal, 0);
				}
			}
			
			public static SqlParameter BranchID
			{
				get
				{
					return new SqlParameter("@BranchID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter StockKey
			{
				get
				{
					return new SqlParameter("@StockKey", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter PartnerPrice
			{
				get
				{
					return new SqlParameter("@PartnerPrice", SqlDbType.Decimal, 0);
				}
			}
			
		}
		#endregion		
	
		#region ColumnNames
		public class ColumnNames
		{  
            public const string ID = "ID";
            public const string ProductName = "ProductName";
            public const string CategoryID = "CategoryID";
            public const string IMEIAvailable = "IMEIAvailable";
            public const string BrandID = "BrandID";
            public const string Description = "Description";
            public const string Picture = "Picture";
            public const string BarCode = "BarCode";
            public const string Cost = "Cost";
            public const string DealerPrice = "DealerPrice";
            public const string SalePrice = "SalePrice";
            public const string Quantity = "Quantity";
            public const string GST = "GST";
            public const string Deleted = "Deleted";
            public const string LastModifiedDate = "LastModifiedDate";
            public const string LastModifiedByUser = "LastModifiedByUser";
            public const string IsNewArrival = "IsNewArrival";
            public const string IsHotProduct = "IsHotProduct";
            public const string Thumbnail = "Thumbnail";
            public const string IsHomeProduct = "IsHomeProduct";
            public const string IsDealerOnly = "IsDealerOnly";
            public const string SoldQuantity = "SoldQuantity";
            public const string RegularPrice = "RegularPrice";
            public const string BranchID = "BranchID";
            public const string StockKey = "StockKey";
            public const string PartnerPrice = "PartnerPrice";

			static public string ToPropertyName(string columnName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[ID] = _Products.PropertyNames.ID;
					ht[ProductName] = _Products.PropertyNames.ProductName;
					ht[CategoryID] = _Products.PropertyNames.CategoryID;
					ht[IMEIAvailable] = _Products.PropertyNames.IMEIAvailable;
					ht[BrandID] = _Products.PropertyNames.BrandID;
					ht[Description] = _Products.PropertyNames.Description;
					ht[Picture] = _Products.PropertyNames.Picture;
					ht[BarCode] = _Products.PropertyNames.BarCode;
					ht[Cost] = _Products.PropertyNames.Cost;
					ht[DealerPrice] = _Products.PropertyNames.DealerPrice;
					ht[SalePrice] = _Products.PropertyNames.SalePrice;
					ht[Quantity] = _Products.PropertyNames.Quantity;
					ht[GST] = _Products.PropertyNames.GST;
					ht[Deleted] = _Products.PropertyNames.Deleted;
					ht[LastModifiedDate] = _Products.PropertyNames.LastModifiedDate;
					ht[LastModifiedByUser] = _Products.PropertyNames.LastModifiedByUser;
					ht[IsNewArrival] = _Products.PropertyNames.IsNewArrival;
					ht[IsHotProduct] = _Products.PropertyNames.IsHotProduct;
					ht[Thumbnail] = _Products.PropertyNames.Thumbnail;
					ht[IsHomeProduct] = _Products.PropertyNames.IsHomeProduct;
					ht[IsDealerOnly] = _Products.PropertyNames.IsDealerOnly;
					ht[SoldQuantity] = _Products.PropertyNames.SoldQuantity;
					ht[RegularPrice] = _Products.PropertyNames.RegularPrice;
					ht[BranchID] = _Products.PropertyNames.BranchID;
					ht[StockKey] = _Products.PropertyNames.StockKey;
					ht[PartnerPrice] = _Products.PropertyNames.PartnerPrice;

				}
				return (string)ht[columnName];
			}

			static private Hashtable ht = null;			 
		}
		#endregion
		
		#region PropertyNames
		public class PropertyNames
		{  
            public const string ID = "ID";
            public const string ProductName = "ProductName";
            public const string CategoryID = "CategoryID";
            public const string IMEIAvailable = "IMEIAvailable";
            public const string BrandID = "BrandID";
            public const string Description = "Description";
            public const string Picture = "Picture";
            public const string BarCode = "BarCode";
            public const string Cost = "Cost";
            public const string DealerPrice = "DealerPrice";
            public const string SalePrice = "SalePrice";
            public const string Quantity = "Quantity";
            public const string GST = "GST";
            public const string Deleted = "Deleted";
            public const string LastModifiedDate = "LastModifiedDate";
            public const string LastModifiedByUser = "LastModifiedByUser";
            public const string IsNewArrival = "IsNewArrival";
            public const string IsHotProduct = "IsHotProduct";
            public const string Thumbnail = "Thumbnail";
            public const string IsHomeProduct = "IsHomeProduct";
            public const string IsDealerOnly = "IsDealerOnly";
            public const string SoldQuantity = "SoldQuantity";
            public const string RegularPrice = "RegularPrice";
            public const string BranchID = "BranchID";
            public const string StockKey = "StockKey";
            public const string PartnerPrice = "PartnerPrice";

			static public string ToColumnName(string propertyName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[ID] = _Products.ColumnNames.ID;
					ht[ProductName] = _Products.ColumnNames.ProductName;
					ht[CategoryID] = _Products.ColumnNames.CategoryID;
					ht[IMEIAvailable] = _Products.ColumnNames.IMEIAvailable;
					ht[BrandID] = _Products.ColumnNames.BrandID;
					ht[Description] = _Products.ColumnNames.Description;
					ht[Picture] = _Products.ColumnNames.Picture;
					ht[BarCode] = _Products.ColumnNames.BarCode;
					ht[Cost] = _Products.ColumnNames.Cost;
					ht[DealerPrice] = _Products.ColumnNames.DealerPrice;
					ht[SalePrice] = _Products.ColumnNames.SalePrice;
					ht[Quantity] = _Products.ColumnNames.Quantity;
					ht[GST] = _Products.ColumnNames.GST;
					ht[Deleted] = _Products.ColumnNames.Deleted;
					ht[LastModifiedDate] = _Products.ColumnNames.LastModifiedDate;
					ht[LastModifiedByUser] = _Products.ColumnNames.LastModifiedByUser;
					ht[IsNewArrival] = _Products.ColumnNames.IsNewArrival;
					ht[IsHotProduct] = _Products.ColumnNames.IsHotProduct;
					ht[Thumbnail] = _Products.ColumnNames.Thumbnail;
					ht[IsHomeProduct] = _Products.ColumnNames.IsHomeProduct;
					ht[IsDealerOnly] = _Products.ColumnNames.IsDealerOnly;
					ht[SoldQuantity] = _Products.ColumnNames.SoldQuantity;
					ht[RegularPrice] = _Products.ColumnNames.RegularPrice;
					ht[BranchID] = _Products.ColumnNames.BranchID;
					ht[StockKey] = _Products.ColumnNames.StockKey;
					ht[PartnerPrice] = _Products.ColumnNames.PartnerPrice;

				}
				return (string)ht[propertyName];
			}

			static private Hashtable ht = null;			 
		}			 
		#endregion	

		#region StringPropertyNames
		public class StringPropertyNames
		{  
            public const string ID = "s_ID";
            public const string ProductName = "s_ProductName";
            public const string CategoryID = "s_CategoryID";
            public const string IMEIAvailable = "s_IMEIAvailable";
            public const string BrandID = "s_BrandID";
            public const string Description = "s_Description";
            public const string Picture = "s_Picture";
            public const string BarCode = "s_BarCode";
            public const string Cost = "s_Cost";
            public const string DealerPrice = "s_DealerPrice";
            public const string SalePrice = "s_SalePrice";
            public const string Quantity = "s_Quantity";
            public const string GST = "s_GST";
            public const string Deleted = "s_Deleted";
            public const string LastModifiedDate = "s_LastModifiedDate";
            public const string LastModifiedByUser = "s_LastModifiedByUser";
            public const string IsNewArrival = "s_IsNewArrival";
            public const string IsHotProduct = "s_IsHotProduct";
            public const string Thumbnail = "s_Thumbnail";
            public const string IsHomeProduct = "s_IsHomeProduct";
            public const string IsDealerOnly = "s_IsDealerOnly";
            public const string SoldQuantity = "s_SoldQuantity";
            public const string RegularPrice = "s_RegularPrice";
            public const string BranchID = "s_BranchID";
            public const string StockKey = "s_StockKey";
            public const string PartnerPrice = "s_PartnerPrice";

		}
		#endregion		
		
		#region Properties
	
		public virtual int ID
	    {
			get
	        {
				return base.Getint(ColumnNames.ID);
			}
			set
	        {
				base.Setint(ColumnNames.ID, value);
			}
		}

		public virtual string ProductName
	    {
			get
	        {
				return base.Getstring(ColumnNames.ProductName);
			}
			set
	        {
				base.Setstring(ColumnNames.ProductName, value);
			}
		}

		public virtual int CategoryID
	    {
			get
	        {
				return base.Getint(ColumnNames.CategoryID);
			}
			set
	        {
				base.Setint(ColumnNames.CategoryID, value);
			}
		}

		public virtual bool IMEIAvailable
	    {
			get
	        {
				return base.Getbool(ColumnNames.IMEIAvailable);
			}
			set
	        {
				base.Setbool(ColumnNames.IMEIAvailable, value);
			}
		}

		public virtual int BrandID
	    {
			get
	        {
				return base.Getint(ColumnNames.BrandID);
			}
			set
	        {
				base.Setint(ColumnNames.BrandID, value);
			}
		}

		public virtual string Description
	    {
			get
	        {
				return base.Getstring(ColumnNames.Description);
			}
			set
	        {
				base.Setstring(ColumnNames.Description, value);
			}
		}

		public virtual string Picture
	    {
			get
	        {
				return base.Getstring(ColumnNames.Picture);
			}
			set
	        {
				base.Setstring(ColumnNames.Picture, value);
			}
		}

		public virtual string BarCode
	    {
			get
	        {
				return base.Getstring(ColumnNames.BarCode);
			}
			set
	        {
				base.Setstring(ColumnNames.BarCode, value);
			}
		}

		public virtual decimal Cost
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.Cost);
			}
			set
	        {
				base.Setdecimal(ColumnNames.Cost, value);
			}
		}

		public virtual decimal DealerPrice
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.DealerPrice);
			}
			set
	        {
				base.Setdecimal(ColumnNames.DealerPrice, value);
			}
		}

		public virtual decimal SalePrice
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.SalePrice);
			}
			set
	        {
				base.Setdecimal(ColumnNames.SalePrice, value);
			}
		}

		public virtual int Quantity
	    {
			get
	        {
				return base.Getint(ColumnNames.Quantity);
			}
			set
	        {
				base.Setint(ColumnNames.Quantity, value);
			}
		}

		public virtual bool GST
	    {
			get
	        {
				return base.Getbool(ColumnNames.GST);
			}
			set
	        {
				base.Setbool(ColumnNames.GST, value);
			}
		}

		public virtual bool Deleted
	    {
			get
	        {
				return base.Getbool(ColumnNames.Deleted);
			}
			set
	        {
				base.Setbool(ColumnNames.Deleted, value);
			}
		}

		public virtual DateTime LastModifiedDate
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.LastModifiedDate);
			}
			set
	        {
				base.SetDateTime(ColumnNames.LastModifiedDate, value);
			}
		}

		public virtual int LastModifiedByUser
	    {
			get
	        {
				return base.Getint(ColumnNames.LastModifiedByUser);
			}
			set
	        {
				base.Setint(ColumnNames.LastModifiedByUser, value);
			}
		}

		public virtual bool IsNewArrival
	    {
			get
	        {
				return base.Getbool(ColumnNames.IsNewArrival);
			}
			set
	        {
				base.Setbool(ColumnNames.IsNewArrival, value);
			}
		}

		public virtual bool IsHotProduct
	    {
			get
	        {
				return base.Getbool(ColumnNames.IsHotProduct);
			}
			set
	        {
				base.Setbool(ColumnNames.IsHotProduct, value);
			}
		}

		public virtual string Thumbnail
	    {
			get
	        {
				return base.Getstring(ColumnNames.Thumbnail);
			}
			set
	        {
				base.Setstring(ColumnNames.Thumbnail, value);
			}
		}

		public virtual bool IsHomeProduct
	    {
			get
	        {
				return base.Getbool(ColumnNames.IsHomeProduct);
			}
			set
	        {
				base.Setbool(ColumnNames.IsHomeProduct, value);
			}
		}

		public virtual bool IsDealerOnly
	    {
			get
	        {
				return base.Getbool(ColumnNames.IsDealerOnly);
			}
			set
	        {
				base.Setbool(ColumnNames.IsDealerOnly, value);
			}
		}

		public virtual int SoldQuantity
	    {
			get
	        {
				return base.Getint(ColumnNames.SoldQuantity);
			}
			set
	        {
				base.Setint(ColumnNames.SoldQuantity, value);
			}
		}

		public virtual decimal RegularPrice
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.RegularPrice);
			}
			set
	        {
				base.Setdecimal(ColumnNames.RegularPrice, value);
			}
		}

		public virtual int BranchID
	    {
			get
	        {
				return base.Getint(ColumnNames.BranchID);
			}
			set
	        {
				base.Setint(ColumnNames.BranchID, value);
			}
		}

		public virtual int StockKey
	    {
			get
	        {
				return base.Getint(ColumnNames.StockKey);
			}
			set
	        {
				base.Setint(ColumnNames.StockKey, value);
			}
		}

		public virtual decimal PartnerPrice
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.PartnerPrice);
			}
			set
	        {
				base.Setdecimal(ColumnNames.PartnerPrice, value);
			}
		}


		#endregion
		
		#region String Properties
	
		public virtual string s_ID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ID) ? string.Empty : base.GetintAsString(ColumnNames.ID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ID);
				else
					this.ID = base.SetintAsString(ColumnNames.ID, value);
			}
		}

		public virtual string s_ProductName
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ProductName) ? string.Empty : base.GetstringAsString(ColumnNames.ProductName);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ProductName);
				else
					this.ProductName = base.SetstringAsString(ColumnNames.ProductName, value);
			}
		}

		public virtual string s_CategoryID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.CategoryID) ? string.Empty : base.GetintAsString(ColumnNames.CategoryID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.CategoryID);
				else
					this.CategoryID = base.SetintAsString(ColumnNames.CategoryID, value);
			}
		}

		public virtual string s_IMEIAvailable
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.IMEIAvailable) ? string.Empty : base.GetboolAsString(ColumnNames.IMEIAvailable);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.IMEIAvailable);
				else
					this.IMEIAvailable = base.SetboolAsString(ColumnNames.IMEIAvailable, value);
			}
		}

		public virtual string s_BrandID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.BrandID) ? string.Empty : base.GetintAsString(ColumnNames.BrandID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.BrandID);
				else
					this.BrandID = base.SetintAsString(ColumnNames.BrandID, value);
			}
		}

		public virtual string s_Description
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Description) ? string.Empty : base.GetstringAsString(ColumnNames.Description);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Description);
				else
					this.Description = base.SetstringAsString(ColumnNames.Description, value);
			}
		}

		public virtual string s_Picture
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Picture) ? string.Empty : base.GetstringAsString(ColumnNames.Picture);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Picture);
				else
					this.Picture = base.SetstringAsString(ColumnNames.Picture, value);
			}
		}

		public virtual string s_BarCode
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.BarCode) ? string.Empty : base.GetstringAsString(ColumnNames.BarCode);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.BarCode);
				else
					this.BarCode = base.SetstringAsString(ColumnNames.BarCode, value);
			}
		}

		public virtual string s_Cost
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Cost) ? string.Empty : base.GetdecimalAsString(ColumnNames.Cost);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Cost);
				else
					this.Cost = base.SetdecimalAsString(ColumnNames.Cost, value);
			}
		}

		public virtual string s_DealerPrice
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.DealerPrice) ? string.Empty : base.GetdecimalAsString(ColumnNames.DealerPrice);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.DealerPrice);
				else
					this.DealerPrice = base.SetdecimalAsString(ColumnNames.DealerPrice, value);
			}
		}

		public virtual string s_SalePrice
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.SalePrice) ? string.Empty : base.GetdecimalAsString(ColumnNames.SalePrice);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.SalePrice);
				else
					this.SalePrice = base.SetdecimalAsString(ColumnNames.SalePrice, value);
			}
		}

		public virtual string s_Quantity
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Quantity) ? string.Empty : base.GetintAsString(ColumnNames.Quantity);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Quantity);
				else
					this.Quantity = base.SetintAsString(ColumnNames.Quantity, value);
			}
		}

		public virtual string s_GST
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.GST) ? string.Empty : base.GetboolAsString(ColumnNames.GST);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.GST);
				else
					this.GST = base.SetboolAsString(ColumnNames.GST, value);
			}
		}

		public virtual string s_Deleted
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Deleted) ? string.Empty : base.GetboolAsString(ColumnNames.Deleted);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Deleted);
				else
					this.Deleted = base.SetboolAsString(ColumnNames.Deleted, value);
			}
		}

		public virtual string s_LastModifiedDate
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.LastModifiedDate) ? string.Empty : base.GetDateTimeAsString(ColumnNames.LastModifiedDate);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.LastModifiedDate);
				else
					this.LastModifiedDate = base.SetDateTimeAsString(ColumnNames.LastModifiedDate, value);
			}
		}

		public virtual string s_LastModifiedByUser
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.LastModifiedByUser) ? string.Empty : base.GetintAsString(ColumnNames.LastModifiedByUser);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.LastModifiedByUser);
				else
					this.LastModifiedByUser = base.SetintAsString(ColumnNames.LastModifiedByUser, value);
			}
		}

		public virtual string s_IsNewArrival
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.IsNewArrival) ? string.Empty : base.GetboolAsString(ColumnNames.IsNewArrival);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.IsNewArrival);
				else
					this.IsNewArrival = base.SetboolAsString(ColumnNames.IsNewArrival, value);
			}
		}

		public virtual string s_IsHotProduct
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.IsHotProduct) ? string.Empty : base.GetboolAsString(ColumnNames.IsHotProduct);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.IsHotProduct);
				else
					this.IsHotProduct = base.SetboolAsString(ColumnNames.IsHotProduct, value);
			}
		}

		public virtual string s_Thumbnail
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Thumbnail) ? string.Empty : base.GetstringAsString(ColumnNames.Thumbnail);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Thumbnail);
				else
					this.Thumbnail = base.SetstringAsString(ColumnNames.Thumbnail, value);
			}
		}

		public virtual string s_IsHomeProduct
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.IsHomeProduct) ? string.Empty : base.GetboolAsString(ColumnNames.IsHomeProduct);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.IsHomeProduct);
				else
					this.IsHomeProduct = base.SetboolAsString(ColumnNames.IsHomeProduct, value);
			}
		}

		public virtual string s_IsDealerOnly
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.IsDealerOnly) ? string.Empty : base.GetboolAsString(ColumnNames.IsDealerOnly);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.IsDealerOnly);
				else
					this.IsDealerOnly = base.SetboolAsString(ColumnNames.IsDealerOnly, value);
			}
		}

		public virtual string s_SoldQuantity
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.SoldQuantity) ? string.Empty : base.GetintAsString(ColumnNames.SoldQuantity);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.SoldQuantity);
				else
					this.SoldQuantity = base.SetintAsString(ColumnNames.SoldQuantity, value);
			}
		}

		public virtual string s_RegularPrice
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.RegularPrice) ? string.Empty : base.GetdecimalAsString(ColumnNames.RegularPrice);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.RegularPrice);
				else
					this.RegularPrice = base.SetdecimalAsString(ColumnNames.RegularPrice, value);
			}
		}

		public virtual string s_BranchID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.BranchID) ? string.Empty : base.GetintAsString(ColumnNames.BranchID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.BranchID);
				else
					this.BranchID = base.SetintAsString(ColumnNames.BranchID, value);
			}
		}

		public virtual string s_StockKey
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.StockKey) ? string.Empty : base.GetintAsString(ColumnNames.StockKey);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.StockKey);
				else
					this.StockKey = base.SetintAsString(ColumnNames.StockKey, value);
			}
		}

		public virtual string s_PartnerPrice
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.PartnerPrice) ? string.Empty : base.GetdecimalAsString(ColumnNames.PartnerPrice);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.PartnerPrice);
				else
					this.PartnerPrice = base.SetdecimalAsString(ColumnNames.PartnerPrice, value);
			}
		}


		#endregion		
	
		#region Where Clause
		public class WhereClause
		{
			public WhereClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffWhereParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffWhereParameter(this);
					}

					return _tearOff;
				}
			}

			#region WhereParameter TearOff's
			public class TearOffWhereParameter
			{
				public TearOffWhereParameter(WhereClause clause)
				{
					this._clause = clause;
				}
				
				
				public WhereParameter ID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ID, Parameters.ID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter ProductName
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ProductName, Parameters.ProductName);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter CategoryID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.CategoryID, Parameters.CategoryID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter IMEIAvailable
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.IMEIAvailable, Parameters.IMEIAvailable);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter BrandID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.BrandID, Parameters.BrandID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Description
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Description, Parameters.Description);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Picture
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Picture, Parameters.Picture);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter BarCode
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.BarCode, Parameters.BarCode);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Cost
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Cost, Parameters.Cost);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter DealerPrice
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.DealerPrice, Parameters.DealerPrice);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter SalePrice
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.SalePrice, Parameters.SalePrice);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Quantity
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Quantity, Parameters.Quantity);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter GST
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.GST, Parameters.GST);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Deleted
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Deleted, Parameters.Deleted);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter LastModifiedDate
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.LastModifiedDate, Parameters.LastModifiedDate);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter LastModifiedByUser
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.LastModifiedByUser, Parameters.LastModifiedByUser);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter IsNewArrival
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.IsNewArrival, Parameters.IsNewArrival);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter IsHotProduct
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.IsHotProduct, Parameters.IsHotProduct);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Thumbnail
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Thumbnail, Parameters.Thumbnail);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter IsHomeProduct
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.IsHomeProduct, Parameters.IsHomeProduct);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter IsDealerOnly
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.IsDealerOnly, Parameters.IsDealerOnly);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter SoldQuantity
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.SoldQuantity, Parameters.SoldQuantity);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter RegularPrice
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.RegularPrice, Parameters.RegularPrice);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter BranchID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.BranchID, Parameters.BranchID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter StockKey
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.StockKey, Parameters.StockKey);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter PartnerPrice
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.PartnerPrice, Parameters.PartnerPrice);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}


				private WhereClause _clause;
			}
			#endregion
		
			public WhereParameter ID
		    {
				get
		        {
					if(_ID_W == null)
	        	    {
						_ID_W = TearOff.ID;
					}
					return _ID_W;
				}
			}

			public WhereParameter ProductName
		    {
				get
		        {
					if(_ProductName_W == null)
	        	    {
						_ProductName_W = TearOff.ProductName;
					}
					return _ProductName_W;
				}
			}

			public WhereParameter CategoryID
		    {
				get
		        {
					if(_CategoryID_W == null)
	        	    {
						_CategoryID_W = TearOff.CategoryID;
					}
					return _CategoryID_W;
				}
			}

			public WhereParameter IMEIAvailable
		    {
				get
		        {
					if(_IMEIAvailable_W == null)
	        	    {
						_IMEIAvailable_W = TearOff.IMEIAvailable;
					}
					return _IMEIAvailable_W;
				}
			}

			public WhereParameter BrandID
		    {
				get
		        {
					if(_BrandID_W == null)
	        	    {
						_BrandID_W = TearOff.BrandID;
					}
					return _BrandID_W;
				}
			}

			public WhereParameter Description
		    {
				get
		        {
					if(_Description_W == null)
	        	    {
						_Description_W = TearOff.Description;
					}
					return _Description_W;
				}
			}

			public WhereParameter Picture
		    {
				get
		        {
					if(_Picture_W == null)
	        	    {
						_Picture_W = TearOff.Picture;
					}
					return _Picture_W;
				}
			}

			public WhereParameter BarCode
		    {
				get
		        {
					if(_BarCode_W == null)
	        	    {
						_BarCode_W = TearOff.BarCode;
					}
					return _BarCode_W;
				}
			}

			public WhereParameter Cost
		    {
				get
		        {
					if(_Cost_W == null)
	        	    {
						_Cost_W = TearOff.Cost;
					}
					return _Cost_W;
				}
			}

			public WhereParameter DealerPrice
		    {
				get
		        {
					if(_DealerPrice_W == null)
	        	    {
						_DealerPrice_W = TearOff.DealerPrice;
					}
					return _DealerPrice_W;
				}
			}

			public WhereParameter SalePrice
		    {
				get
		        {
					if(_SalePrice_W == null)
	        	    {
						_SalePrice_W = TearOff.SalePrice;
					}
					return _SalePrice_W;
				}
			}

			public WhereParameter Quantity
		    {
				get
		        {
					if(_Quantity_W == null)
	        	    {
						_Quantity_W = TearOff.Quantity;
					}
					return _Quantity_W;
				}
			}

			public WhereParameter GST
		    {
				get
		        {
					if(_GST_W == null)
	        	    {
						_GST_W = TearOff.GST;
					}
					return _GST_W;
				}
			}

			public WhereParameter Deleted
		    {
				get
		        {
					if(_Deleted_W == null)
	        	    {
						_Deleted_W = TearOff.Deleted;
					}
					return _Deleted_W;
				}
			}

			public WhereParameter LastModifiedDate
		    {
				get
		        {
					if(_LastModifiedDate_W == null)
	        	    {
						_LastModifiedDate_W = TearOff.LastModifiedDate;
					}
					return _LastModifiedDate_W;
				}
			}

			public WhereParameter LastModifiedByUser
		    {
				get
		        {
					if(_LastModifiedByUser_W == null)
	        	    {
						_LastModifiedByUser_W = TearOff.LastModifiedByUser;
					}
					return _LastModifiedByUser_W;
				}
			}

			public WhereParameter IsNewArrival
		    {
				get
		        {
					if(_IsNewArrival_W == null)
	        	    {
						_IsNewArrival_W = TearOff.IsNewArrival;
					}
					return _IsNewArrival_W;
				}
			}

			public WhereParameter IsHotProduct
		    {
				get
		        {
					if(_IsHotProduct_W == null)
	        	    {
						_IsHotProduct_W = TearOff.IsHotProduct;
					}
					return _IsHotProduct_W;
				}
			}

			public WhereParameter Thumbnail
		    {
				get
		        {
					if(_Thumbnail_W == null)
	        	    {
						_Thumbnail_W = TearOff.Thumbnail;
					}
					return _Thumbnail_W;
				}
			}

			public WhereParameter IsHomeProduct
		    {
				get
		        {
					if(_IsHomeProduct_W == null)
	        	    {
						_IsHomeProduct_W = TearOff.IsHomeProduct;
					}
					return _IsHomeProduct_W;
				}
			}

			public WhereParameter IsDealerOnly
		    {
				get
		        {
					if(_IsDealerOnly_W == null)
	        	    {
						_IsDealerOnly_W = TearOff.IsDealerOnly;
					}
					return _IsDealerOnly_W;
				}
			}

			public WhereParameter SoldQuantity
		    {
				get
		        {
					if(_SoldQuantity_W == null)
	        	    {
						_SoldQuantity_W = TearOff.SoldQuantity;
					}
					return _SoldQuantity_W;
				}
			}

			public WhereParameter RegularPrice
		    {
				get
		        {
					if(_RegularPrice_W == null)
	        	    {
						_RegularPrice_W = TearOff.RegularPrice;
					}
					return _RegularPrice_W;
				}
			}

			public WhereParameter BranchID
		    {
				get
		        {
					if(_BranchID_W == null)
	        	    {
						_BranchID_W = TearOff.BranchID;
					}
					return _BranchID_W;
				}
			}

			public WhereParameter StockKey
		    {
				get
		        {
					if(_StockKey_W == null)
	        	    {
						_StockKey_W = TearOff.StockKey;
					}
					return _StockKey_W;
				}
			}

			public WhereParameter PartnerPrice
		    {
				get
		        {
					if(_PartnerPrice_W == null)
	        	    {
						_PartnerPrice_W = TearOff.PartnerPrice;
					}
					return _PartnerPrice_W;
				}
			}

			private WhereParameter _ID_W = null;
			private WhereParameter _ProductName_W = null;
			private WhereParameter _CategoryID_W = null;
			private WhereParameter _IMEIAvailable_W = null;
			private WhereParameter _BrandID_W = null;
			private WhereParameter _Description_W = null;
			private WhereParameter _Picture_W = null;
			private WhereParameter _BarCode_W = null;
			private WhereParameter _Cost_W = null;
			private WhereParameter _DealerPrice_W = null;
			private WhereParameter _SalePrice_W = null;
			private WhereParameter _Quantity_W = null;
			private WhereParameter _GST_W = null;
			private WhereParameter _Deleted_W = null;
			private WhereParameter _LastModifiedDate_W = null;
			private WhereParameter _LastModifiedByUser_W = null;
			private WhereParameter _IsNewArrival_W = null;
			private WhereParameter _IsHotProduct_W = null;
			private WhereParameter _Thumbnail_W = null;
			private WhereParameter _IsHomeProduct_W = null;
			private WhereParameter _IsDealerOnly_W = null;
			private WhereParameter _SoldQuantity_W = null;
			private WhereParameter _RegularPrice_W = null;
			private WhereParameter _BranchID_W = null;
			private WhereParameter _StockKey_W = null;
			private WhereParameter _PartnerPrice_W = null;

			public void WhereClauseReset()
			{
				_ID_W = null;
				_ProductName_W = null;
				_CategoryID_W = null;
				_IMEIAvailable_W = null;
				_BrandID_W = null;
				_Description_W = null;
				_Picture_W = null;
				_BarCode_W = null;
				_Cost_W = null;
				_DealerPrice_W = null;
				_SalePrice_W = null;
				_Quantity_W = null;
				_GST_W = null;
				_Deleted_W = null;
				_LastModifiedDate_W = null;
				_LastModifiedByUser_W = null;
				_IsNewArrival_W = null;
				_IsHotProduct_W = null;
				_Thumbnail_W = null;
				_IsHomeProduct_W = null;
				_IsDealerOnly_W = null;
				_SoldQuantity_W = null;
				_RegularPrice_W = null;
				_BranchID_W = null;
				_StockKey_W = null;
				_PartnerPrice_W = null;

				this._entity.Query.FlushWhereParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffWhereParameter _tearOff;
			
		}
	
		public WhereClause Where
		{
			get
			{
				if(_whereClause == null)
				{
					_whereClause = new WhereClause(this);
				}
		
				return _whereClause;
			}
		}
		
		private WhereClause _whereClause = null;	
		#endregion
	
		#region Aggregate Clause
		public class AggregateClause
		{
			public AggregateClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffAggregateParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffAggregateParameter(this);
					}

					return _tearOff;
				}
			}

			#region AggregateParameter TearOff's
			public class TearOffAggregateParameter
			{
				public TearOffAggregateParameter(AggregateClause clause)
				{
					this._clause = clause;
				}
				
				
				public AggregateParameter ID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ID, Parameters.ID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter ProductName
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ProductName, Parameters.ProductName);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter CategoryID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.CategoryID, Parameters.CategoryID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter IMEIAvailable
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.IMEIAvailable, Parameters.IMEIAvailable);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter BrandID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.BrandID, Parameters.BrandID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Description
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Description, Parameters.Description);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Picture
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Picture, Parameters.Picture);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter BarCode
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.BarCode, Parameters.BarCode);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Cost
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Cost, Parameters.Cost);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter DealerPrice
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.DealerPrice, Parameters.DealerPrice);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter SalePrice
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.SalePrice, Parameters.SalePrice);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Quantity
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Quantity, Parameters.Quantity);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter GST
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.GST, Parameters.GST);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Deleted
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Deleted, Parameters.Deleted);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter LastModifiedDate
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.LastModifiedDate, Parameters.LastModifiedDate);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter LastModifiedByUser
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.LastModifiedByUser, Parameters.LastModifiedByUser);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter IsNewArrival
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.IsNewArrival, Parameters.IsNewArrival);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter IsHotProduct
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.IsHotProduct, Parameters.IsHotProduct);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Thumbnail
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Thumbnail, Parameters.Thumbnail);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter IsHomeProduct
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.IsHomeProduct, Parameters.IsHomeProduct);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter IsDealerOnly
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.IsDealerOnly, Parameters.IsDealerOnly);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter SoldQuantity
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.SoldQuantity, Parameters.SoldQuantity);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter RegularPrice
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.RegularPrice, Parameters.RegularPrice);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter BranchID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.BranchID, Parameters.BranchID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter StockKey
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.StockKey, Parameters.StockKey);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter PartnerPrice
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.PartnerPrice, Parameters.PartnerPrice);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}


				private AggregateClause _clause;
			}
			#endregion
		
			public AggregateParameter ID
		    {
				get
		        {
					if(_ID_W == null)
	        	    {
						_ID_W = TearOff.ID;
					}
					return _ID_W;
				}
			}

			public AggregateParameter ProductName
		    {
				get
		        {
					if(_ProductName_W == null)
	        	    {
						_ProductName_W = TearOff.ProductName;
					}
					return _ProductName_W;
				}
			}

			public AggregateParameter CategoryID
		    {
				get
		        {
					if(_CategoryID_W == null)
	        	    {
						_CategoryID_W = TearOff.CategoryID;
					}
					return _CategoryID_W;
				}
			}

			public AggregateParameter IMEIAvailable
		    {
				get
		        {
					if(_IMEIAvailable_W == null)
	        	    {
						_IMEIAvailable_W = TearOff.IMEIAvailable;
					}
					return _IMEIAvailable_W;
				}
			}

			public AggregateParameter BrandID
		    {
				get
		        {
					if(_BrandID_W == null)
	        	    {
						_BrandID_W = TearOff.BrandID;
					}
					return _BrandID_W;
				}
			}

			public AggregateParameter Description
		    {
				get
		        {
					if(_Description_W == null)
	        	    {
						_Description_W = TearOff.Description;
					}
					return _Description_W;
				}
			}

			public AggregateParameter Picture
		    {
				get
		        {
					if(_Picture_W == null)
	        	    {
						_Picture_W = TearOff.Picture;
					}
					return _Picture_W;
				}
			}

			public AggregateParameter BarCode
		    {
				get
		        {
					if(_BarCode_W == null)
	        	    {
						_BarCode_W = TearOff.BarCode;
					}
					return _BarCode_W;
				}
			}

			public AggregateParameter Cost
		    {
				get
		        {
					if(_Cost_W == null)
	        	    {
						_Cost_W = TearOff.Cost;
					}
					return _Cost_W;
				}
			}

			public AggregateParameter DealerPrice
		    {
				get
		        {
					if(_DealerPrice_W == null)
	        	    {
						_DealerPrice_W = TearOff.DealerPrice;
					}
					return _DealerPrice_W;
				}
			}

			public AggregateParameter SalePrice
		    {
				get
		        {
					if(_SalePrice_W == null)
	        	    {
						_SalePrice_W = TearOff.SalePrice;
					}
					return _SalePrice_W;
				}
			}

			public AggregateParameter Quantity
		    {
				get
		        {
					if(_Quantity_W == null)
	        	    {
						_Quantity_W = TearOff.Quantity;
					}
					return _Quantity_W;
				}
			}

			public AggregateParameter GST
		    {
				get
		        {
					if(_GST_W == null)
	        	    {
						_GST_W = TearOff.GST;
					}
					return _GST_W;
				}
			}

			public AggregateParameter Deleted
		    {
				get
		        {
					if(_Deleted_W == null)
	        	    {
						_Deleted_W = TearOff.Deleted;
					}
					return _Deleted_W;
				}
			}

			public AggregateParameter LastModifiedDate
		    {
				get
		        {
					if(_LastModifiedDate_W == null)
	        	    {
						_LastModifiedDate_W = TearOff.LastModifiedDate;
					}
					return _LastModifiedDate_W;
				}
			}

			public AggregateParameter LastModifiedByUser
		    {
				get
		        {
					if(_LastModifiedByUser_W == null)
	        	    {
						_LastModifiedByUser_W = TearOff.LastModifiedByUser;
					}
					return _LastModifiedByUser_W;
				}
			}

			public AggregateParameter IsNewArrival
		    {
				get
		        {
					if(_IsNewArrival_W == null)
	        	    {
						_IsNewArrival_W = TearOff.IsNewArrival;
					}
					return _IsNewArrival_W;
				}
			}

			public AggregateParameter IsHotProduct
		    {
				get
		        {
					if(_IsHotProduct_W == null)
	        	    {
						_IsHotProduct_W = TearOff.IsHotProduct;
					}
					return _IsHotProduct_W;
				}
			}

			public AggregateParameter Thumbnail
		    {
				get
		        {
					if(_Thumbnail_W == null)
	        	    {
						_Thumbnail_W = TearOff.Thumbnail;
					}
					return _Thumbnail_W;
				}
			}

			public AggregateParameter IsHomeProduct
		    {
				get
		        {
					if(_IsHomeProduct_W == null)
	        	    {
						_IsHomeProduct_W = TearOff.IsHomeProduct;
					}
					return _IsHomeProduct_W;
				}
			}

			public AggregateParameter IsDealerOnly
		    {
				get
		        {
					if(_IsDealerOnly_W == null)
	        	    {
						_IsDealerOnly_W = TearOff.IsDealerOnly;
					}
					return _IsDealerOnly_W;
				}
			}

			public AggregateParameter SoldQuantity
		    {
				get
		        {
					if(_SoldQuantity_W == null)
	        	    {
						_SoldQuantity_W = TearOff.SoldQuantity;
					}
					return _SoldQuantity_W;
				}
			}

			public AggregateParameter RegularPrice
		    {
				get
		        {
					if(_RegularPrice_W == null)
	        	    {
						_RegularPrice_W = TearOff.RegularPrice;
					}
					return _RegularPrice_W;
				}
			}

			public AggregateParameter BranchID
		    {
				get
		        {
					if(_BranchID_W == null)
	        	    {
						_BranchID_W = TearOff.BranchID;
					}
					return _BranchID_W;
				}
			}

			public AggregateParameter StockKey
		    {
				get
		        {
					if(_StockKey_W == null)
	        	    {
						_StockKey_W = TearOff.StockKey;
					}
					return _StockKey_W;
				}
			}

			public AggregateParameter PartnerPrice
		    {
				get
		        {
					if(_PartnerPrice_W == null)
	        	    {
						_PartnerPrice_W = TearOff.PartnerPrice;
					}
					return _PartnerPrice_W;
				}
			}

			private AggregateParameter _ID_W = null;
			private AggregateParameter _ProductName_W = null;
			private AggregateParameter _CategoryID_W = null;
			private AggregateParameter _IMEIAvailable_W = null;
			private AggregateParameter _BrandID_W = null;
			private AggregateParameter _Description_W = null;
			private AggregateParameter _Picture_W = null;
			private AggregateParameter _BarCode_W = null;
			private AggregateParameter _Cost_W = null;
			private AggregateParameter _DealerPrice_W = null;
			private AggregateParameter _SalePrice_W = null;
			private AggregateParameter _Quantity_W = null;
			private AggregateParameter _GST_W = null;
			private AggregateParameter _Deleted_W = null;
			private AggregateParameter _LastModifiedDate_W = null;
			private AggregateParameter _LastModifiedByUser_W = null;
			private AggregateParameter _IsNewArrival_W = null;
			private AggregateParameter _IsHotProduct_W = null;
			private AggregateParameter _Thumbnail_W = null;
			private AggregateParameter _IsHomeProduct_W = null;
			private AggregateParameter _IsDealerOnly_W = null;
			private AggregateParameter _SoldQuantity_W = null;
			private AggregateParameter _RegularPrice_W = null;
			private AggregateParameter _BranchID_W = null;
			private AggregateParameter _StockKey_W = null;
			private AggregateParameter _PartnerPrice_W = null;

			public void AggregateClauseReset()
			{
				_ID_W = null;
				_ProductName_W = null;
				_CategoryID_W = null;
				_IMEIAvailable_W = null;
				_BrandID_W = null;
				_Description_W = null;
				_Picture_W = null;
				_BarCode_W = null;
				_Cost_W = null;
				_DealerPrice_W = null;
				_SalePrice_W = null;
				_Quantity_W = null;
				_GST_W = null;
				_Deleted_W = null;
				_LastModifiedDate_W = null;
				_LastModifiedByUser_W = null;
				_IsNewArrival_W = null;
				_IsHotProduct_W = null;
				_Thumbnail_W = null;
				_IsHomeProduct_W = null;
				_IsDealerOnly_W = null;
				_SoldQuantity_W = null;
				_RegularPrice_W = null;
				_BranchID_W = null;
				_StockKey_W = null;
				_PartnerPrice_W = null;

				this._entity.Query.FlushAggregateParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffAggregateParameter _tearOff;
			
		}
	
		public AggregateClause Aggregate
		{
			get
			{
				if(_aggregateClause == null)
				{
					_aggregateClause = new AggregateClause(this);
				}
		
				return _aggregateClause;
			}
		}
		
		private AggregateClause _aggregateClause = null;	
		#endregion
	
		protected override IDbCommand GetInsertCommand() 
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_ProductsInsert]";
	
			CreateParameters(cmd);
			
			SqlParameter p;
			p = cmd.Parameters[Parameters.ID.ParameterName];
			p.Direction = ParameterDirection.Output;
    
			return cmd;
		}
	
		protected override IDbCommand GetUpdateCommand()
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_ProductsUpdate]";
	
			CreateParameters(cmd);
			      
			return cmd;
		}
	
		protected override IDbCommand GetDeleteCommand()
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_ProductsDelete]";
	
			SqlParameter p;
			p = cmd.Parameters.Add(Parameters.ID);
			p.SourceColumn = ColumnNames.ID;
			p.SourceVersion = DataRowVersion.Current;

  
			return cmd;
		}
		
		private IDbCommand CreateParameters(SqlCommand cmd)
		{
			SqlParameter p;
		
			p = cmd.Parameters.Add(Parameters.ID);
			p.SourceColumn = ColumnNames.ID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.ProductName);
			p.SourceColumn = ColumnNames.ProductName;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.CategoryID);
			p.SourceColumn = ColumnNames.CategoryID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.IMEIAvailable);
			p.SourceColumn = ColumnNames.IMEIAvailable;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.BrandID);
			p.SourceColumn = ColumnNames.BrandID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Description);
			p.SourceColumn = ColumnNames.Description;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Picture);
			p.SourceColumn = ColumnNames.Picture;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.BarCode);
			p.SourceColumn = ColumnNames.BarCode;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Cost);
			p.SourceColumn = ColumnNames.Cost;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.DealerPrice);
			p.SourceColumn = ColumnNames.DealerPrice;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.SalePrice);
			p.SourceColumn = ColumnNames.SalePrice;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Quantity);
			p.SourceColumn = ColumnNames.Quantity;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.GST);
			p.SourceColumn = ColumnNames.GST;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Deleted);
			p.SourceColumn = ColumnNames.Deleted;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.LastModifiedDate);
			p.SourceColumn = ColumnNames.LastModifiedDate;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.LastModifiedByUser);
			p.SourceColumn = ColumnNames.LastModifiedByUser;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.IsNewArrival);
			p.SourceColumn = ColumnNames.IsNewArrival;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.IsHotProduct);
			p.SourceColumn = ColumnNames.IsHotProduct;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Thumbnail);
			p.SourceColumn = ColumnNames.Thumbnail;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.IsHomeProduct);
			p.SourceColumn = ColumnNames.IsHomeProduct;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.IsDealerOnly);
			p.SourceColumn = ColumnNames.IsDealerOnly;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.SoldQuantity);
			p.SourceColumn = ColumnNames.SoldQuantity;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.RegularPrice);
			p.SourceColumn = ColumnNames.RegularPrice;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.BranchID);
			p.SourceColumn = ColumnNames.BranchID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.StockKey);
			p.SourceColumn = ColumnNames.StockKey;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.PartnerPrice);
			p.SourceColumn = ColumnNames.PartnerPrice;
			p.SourceVersion = DataRowVersion.Current;


			return cmd;
		}
	}
}
